home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Format / ascii2fax / fonts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  1.1 KB  |  48 lines

  1. /* fonts.h: local representation of font */
  2.  
  3. /*
  4.  * $Header: /xtel/pp/pp-beta/Format/ascii2fax/RCS/fonts.h,v 6.0 1991/12/18 20:15:19 jpo Rel $
  5.  *
  6.  * $Log: fonts.h,v $
  7.  * Revision 6.0  1991/12/18  20:15:19  jpo
  8.  * Release 6.0
  9.  *
  10.  *
  11.  */
  12. #include    "util.h"
  13. #include    "sys.file.h"
  14.  
  15. typedef int *BitLine;
  16. typedef    BitLine *BitMap;
  17.  
  18. #define    BITSPERCHAR    8
  19. #define    BITSPERINT    16
  20. #define MAXCHARPERINT    8
  21.  
  22. /* nicked from FD_SET etc in sys/types.h */
  23. #define BL_SET(n, l)    ((l)[(n)/BITSPERINT] |= (1 << ((n) % BITSPERINT)))
  24. #define BL_CLR(n, l)    ((l)[(n)/BITSPERINT] &= ~(1 << ((n) % BITSPERINT)))
  25. #define BL_ISSET(n, l)    ((l)[(n)/BITSPERINT] & (1 << ((n) % BITSPERINT)))
  26.  
  27. #define BL_WD2CHAR(w)    ((w)/BITSPERCHAR + 1)
  28. #define BL_WD2INT(w)    ((w)/BITSPERINT + 1)
  29.  
  30. typedef struct _char {
  31.     int    ascii;
  32.     int    wid;    /* in pixels */
  33.     int    ht;    /* in pixels */
  34.     BitMap    bits;    
  35. } Char, *CharPtr;
  36.  
  37. typedef struct _font {
  38.     int    max_wid, max_ht;
  39.     int    nchars;
  40.     CharPtr    *chars;    /* [nchars] indexed by ascii value */
  41. } PPFont, *PPFontPtr;
  42.  
  43. typedef struct _str {
  44.     int    nchars;
  45.     CharPtr    *chars;
  46.     char    *orig;
  47. } Str, *StrPtr;
  48.